<template>
	<view>
		token：{{user.token}}
		<wd-cell title="登录页" @click="onLogin" is-link />
		<wd-cell title="退出登录" @click="onLogout" is-link />
	</view>
</template>

<script setup>
	import {
		onLoad
	} from '@dcloudio/uni-app'
	import {
		useAuthCheck
	} from '@/common/auth'
	import {
		useUserStore
	} from '@/stores/user';

	const user = useUserStore();
	onLoad(() => {
		useAuthCheck()
	})

	function onLogout() {
		user.logout()
	}
	
	function onLogin(){
		uni.navigateTo({
			url:'/pages/auth/login'
		})
	}
</script>

<style>

</style>